package com.woniu.airent.controller;

import com.github.pagehelper.PageInfo;
import com.woniu.airent.entity.House;
import com.woniu.airent.service.impl.HouseExamineServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Controller
@RequestMapping("house")
public class HouseExamineController {
    @Autowired
    HouseExamineServiceImpl houseExamineServiceImpl;

    @RequestMapping("/examine")
    public String houseExamine(Map map,
                               @RequestParam(value = "examine" ,defaultValue ="3" )Integer examine,
                               @RequestParam(value = "pageNow",defaultValue = "1") Integer pageNow,
                               @RequestParam(value = "pageSize",defaultValue = "2") Integer pageSize){
        PageInfo<House> pageInfo = houseExamineServiceImpl.examineHouse(examine,pageNow, pageSize);
        map.put("pageInfo",pageInfo);
        map.put("mxamine",examine);
        return "manager/houseExamine";
    }

    @RequestMapping("/yesUpdate")
    public String yesUpdate(int hid){
        int i=houseExamineServiceImpl.yesUpdate(hid);
        return "manager/houseExamine";
    }

    @RequestMapping("/noUpdate")
    public String noUpdate(int hid){
        int i=houseExamineServiceImpl.noUpdate(hid);
        return "manager/houseExamine";
    }


}
